/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entityBeans;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author allankv
 */
@Entity
@Table(name = "phylum")
@NamedQueries({
    @NamedQuery(name = "Phylum.findAll", query = "SELECT p FROM Phylum p"),
    @NamedQuery(name = "Phylum.findByIdphylum", query = "SELECT p FROM Phylum p WHERE p.idphylum = :idphylum"),
    @NamedQuery(name = "Phylum.findByPhylum", query = "SELECT p FROM Phylum p WHERE p.phylum = :phylum")})
public class Phylum implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idphylum")
    private Integer idphylum;
    @Basic(optional = false)
    @Column(name = "phylum")
    private String phylum;
    @OneToMany(mappedBy = "phylum", fetch = FetchType.LAZY)
    private List<Taxonomicelement> taxonomicelementList;

    public Phylum() {
    }

    public Phylum(Integer idphylum) {
        this.idphylum = idphylum;
    }

    public Phylum(Integer idphylum, String phylum) {
        this.idphylum = idphylum;
        this.phylum = phylum;
    }

    public Integer getIdphylum() {
        return idphylum;
    }

    public void setIdphylum(Integer idphylum) {
        this.idphylum = idphylum;
    }

    public String getPhylum() {
        return phylum;
    }

    public void setPhylum(String phylum) {
        this.phylum = phylum;
    }

    public List<Taxonomicelement> getTaxonomicelementList() {
        return taxonomicelementList;
    }

    public void setTaxonomicelementList(List<Taxonomicelement> taxonomicelementList) {
        this.taxonomicelementList = taxonomicelementList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idphylum != null ? idphylum.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Phylum)) {
            return false;
        }
        Phylum other = (Phylum) object;
        if ((this.idphylum == null && other.idphylum != null) || (this.idphylum != null && !this.idphylum.equals(other.idphylum))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityBeans.Phylum[idphylum=" + idphylum + "]";
    }

}
